<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title></title>
<%@ include file="/common/meta.jsp"%>
<script type="text/javascript">
var prcWin = new progressWin("${res}");//初始化遮罩层

$(document).ready(function(){
	$("#submit").click(function(){
		
		var opn = $("#opinion").val();
		if(opn==null||opn==""){
			opn = $("#opinion").text();
		}
		if($.trim(opn).length==0){
			scmWarn("请输入退回意见!");
			return false;
		}
		if(opn.length>500){
			//alert(opn);
			scmWarn("退回意见限500字内!");
			return false;
		}
		var options = {
				beforeSubmit : function() {
					$("#submit").attr("disabled",true);
					prcWin.openWin();//打开遮罩层
				}, // 表单提交前的回调函数
				success : function(msg) {
					if(msg.indexOf('操作成功')!=-1 || msg=='success'){
						  if (msg.indexOf("政务网")!=-1) {
                              scmError(msg);
                          } else {
                        	  scmSuccess(msg);
                          }
					}
					else{
						scmWarn(msg);
				    }
					prcWin.closeWin();
					parent.$("#searchBt").click();
					//parent.irisGrid.getGridDom().jqGrid("refresh",0);//0是本页1是首页
					parent.currefresh=false;
					window.setTimeout("parent.tb_remove()", 2000);
				},// 表单成功提交后的回调函数
				error : function() {
					scmError("操作失败,请联系系统管理员");
					prcWin.closeWin();
				},
				url: "${ctx}/prpapprove/updateCheckedForPaper"
			};
		$("#mainForm").ajaxSubmit(options);
	//	parent.irisGrid.getGridDom().jqGrid("refresh",0);//0是本页1是首页
		
	});
	$("#back").click(function(){
		//parent.irisGrid.getGridDom().jqGrid("refresh",0);//0是本页1是首页
		//parent.$("#searchBt").click();
		parent.tb_remove();
	});
	
});
</script>
</head>
<body>
	<form method="post" id="mainForm">
		<input type="hidden" name="prpCodes" value="${param.prpCodes}" />
		<input type="hidden" name="status" value="${param.status}" />
		<input type="hidden" name="returnPaperFlag" value="returnPaper" />
		 <table class="t_css" width="100%" border="0" cellpadding="0" cellspacing="1">
	        <tr class="li_1">
	          <td width="100%"><textarea name="opinion" id="opinion" style="width:100%" rows="10" maxlength="500" onfocus="InitInput.setMaxLength(this,500)"></textarea></td>
	        </tr>
      	</table>
      	<br/>
      <div style="text-align: center;">
      	&nbsp;<input type="button" class="button_01" value="退回修改" id="submit"/>
      	&nbsp;<input type="button" class="button_01" value="返回" id="back"/>
	  </div>
	</form>
</body>
</html>